package com.lbmb.mdps.workbench.controller;

import com.lbmb.mdps.commons.constant.Constant;
import com.lbmb.mdps.commons.domain.ReturnObjectVO;
import com.lbmb.mdps.commons.domain.ThirdPartVo;
import com.lbmb.mdps.commons.domain.WarehouseVo;
import com.lbmb.mdps.workbench.dao.ThirdPartyDao;
import com.lbmb.mdps.workbench.service.ThirdPartService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 林文塨
 * @date 2022-06-02 1:34
 * description
 */
@CrossOrigin
@RestController
public class ThirdPartController {

    @Resource
    private ThirdPartService thirdPartService;

    @GetMapping( "/workbench/thirdPart/getThirdPartData.do")
    public ReturnObjectVO getThirdPartData() {
        /*
         * 获得全部第三方数据
         * @author 林文塨
         * @date 2022/6/2 1:34
         * @param []
         * @return com.lbmb.mdps.commons.domain.ReturnObjectVO
         */
        ReturnObjectVO rov = new ReturnObjectVO();

        List<ThirdPartVo> thirdPartDate = thirdPartService.getAllThirdPart();

        rov.setCode(Constant.RETURN_OBJECT_CODE_SUCCESS);
        rov.setOthers(thirdPartDate);

        return rov;
    }
}
